package meetingcostclock;

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;

public class Starter {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		if(args.length < 2) {
			String message = "Usage: javaw workdays.Workdays <number of participants> <hourly rate>\n";

			Display display = new Display();
	        //Shell shell = new Shell(display, SWT.CLOSE|SWT.TITLE|SWT.TOOL);
			Shell shell = new Shell(display, SWT.ON_TOP|SWT.CLOSE|SWT.TITLE|SWT.TOOL);
	        shell.setLayout (new FillLayout());
	        shell.setSize(500, 45);
			shell.setText("Meeting Cost Clock");
	        Label label = new Label (shell, SWT.BORDER);
	        label.setAlignment(SWT.LEFT);
	        label.setText(message);
	        Font fnt = new Font(label.getFont().getDevice(), "Verdana", 8, 0);  
	        label.setFont(fnt);
	        shell.open ();
	        while (!shell.isDisposed ()) {
	            if (!display.readAndDispatch ()) display.sleep ();
	        }
			display.dispose();
			System.exit(-1);
		}
		
		int noOfParticipants = Integer.parseInt(args[0]);
		int rate = Integer.parseInt(args[1]);
		
		new MeetingCostClock(noOfParticipants, rate);
	}

}
